﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using SchoolProject2012.Langue;

namespace SchoolProject2012.Areas.Eleve.Models
{
    public class EleveSchoolProject
    {
        [MetadataType(typeof(EleveCV))]
        public class ELEVE
        {
            public string LOGINPERS { get; set; }
            public string NOMPERS { get; set; }
            public string PRENOMPERS { get; set; }
            public DateTime DATENAISSPERS { get; set; }
            public string MAILPERS { get; set; }
            public string NUMTELPERS { get; set; }
            public string ADRESSEPERS { get; set; }
            public string VILLEPERS { get; set; }
            public string CPPERS { get; set; }
            public string CHA_LOGINPERS { get; set; }
        }

        public class EleveCV
        {
            [Display(ResourceType = typeof(Resources), Name = "Login")]
            public string LOGINPERS { get; set; }
            [Display(ResourceType = typeof(Resources), Name = "Nom")]
            public string NOMPERS { get; set; }
            [Display(ResourceType = typeof(Resources), Name = "Prenom")]
            public string PRENOMPERS { get; set; }
            [Display(ResourceType = typeof(Resources), Name = "Chargé de placement")]
            public string CHA_LOGINPERS { get; set; }
            [Display(ResourceType = typeof(Resources), Name = "Date de naissance")]
            public DateTime DATENAISSPERS { get; set; }
            [StringLength(255)]
            [DataType(DataType.EmailAddress)]
            [RegularExpression(@"^[a-z0-9.-]+@[a-z0-9.-]{2,}\.[a-z]{2,4}$", ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessageMail")]
            [Display(ResourceType = typeof(Resources), Name = "email")]
            public string MAILPERS { get; set; }
            [StringLength(50)]
            [DataType(DataType.PhoneNumber)]
            [Display(ResourceType = typeof(Resources), Name = "Numéro de téléphone")]
            [RegularExpression(@"^[0-9.+()\s-]*$", ErrorMessage = "Mauvais format")]
            public string NUMTELPERS { get; set; }
            [Display(ResourceType = typeof(Resources), Name = "Adresse")]
            public string ADRESSEPERS { get; set; }
            [Display(ResourceType = typeof(Resources), Name = "Ville")]
            public string VILLEPERS { get; set; }
            [StringLength(5)]
            [Display(ResourceType = typeof(Resources), Name = "Code postal")]
            public string CPPERS { get; set; }
        }
    }
}